<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><%= yield(:title) || "Untitled" %></title>
    <%= stylesheet_link_tag "application", "formtastic", "formtastic_changes", :cache => "base" %>
    <%= javascript_include_tag :defaults %>
    <%= csrf_meta_tag %>
    <%= yield(:head) %>
  </head>
  <body>
    <div id="container">
      <div id="user_nav">
        <% if user_signed_in? %>
          Signed in as <%= current_user.username.capitalize %>. Not you?
          <%= link_to "Sign out", destroy_user_session_path %>
        <% else %>
          <%= link_to "Sign up", new_user_registration_path %> or <%= link_to "sign in", new_user_session_path %>.
        <% end %>
      </div>
      
      <% flash.each do |name, msg| %>
        <%= content_tag :div, msg, :id => "flash_#{name}" %>
      <% end %>
      <%= content_tag :h1, yield(:title) if show_title? %>
      <%= yield %>
    </div>
  </body>
</html>
